from django.db import models

# Create your models here.
from school.models import School
import django.utils.timezone as timezone


class CompetitionSeason(models.Model):
    IS_ACTIVE = [
        (0, '无效'),
        (1, '有效')
    ]
    competition_name = models.CharField(max_length=125, verbose_name='赛季名称', help_text='赛季名称', db_index=True)
    holding_time = models.DateField(verbose_name='比赛时间', help_text='比赛时间', db_index=True, default=timezone.now().date())
    Venue = models.CharField(max_length=225,verbose_name='比赛地点', help_text='比赛地点', db_index=True, default='', blank=True, null=True)
    is_active = models.IntegerField(choices=IS_ACTIVE,default=1)

    class Meta:
        verbose_name = "赛季"
        verbose_name_plural = verbose_name
        ordering = ['-holding_time']

    def __str__(self):
        return self.competition_name
